import React, { Component } from 'react';

import { Carousel } from 'antd-mobile';
import pic from '../../assets/images/1.png'

class Slide extends Component {
    state = {
        data: ['1', '2', '3'],
    }

    render() {
        return (
            <div>
                <Carousel
                    autoplay={true}
                    infinite
                    >
                    {this.state.data.map(val => (
                        <a
                            key={val}
                            href="http://www.baidu.com"
                            style={{ display: 'inline-block', width: '100%', height: '10.6rem' }}
                            >
                            <img
                                src={pic}
                                alt=""
                                style={{ width: '100%', verticalAlign: 'top' }}
                            />
                        </a>
                    ))}
                </Carousel>
            </div>
        )
    }
}

class Home extends Component {
    render() {
        return (
            <Slide />
        );
    }
}

export default Home;